﻿/*-----------------------------------------------------------------------------------------------
// Copyright (C) zhangjianmin 
//
// 文件名：        SysUserController.cs
// 文件功能描述：   任务列表管理控制器
//
// 
// 创建标识：       张建敏  2016-06-07
//
// 修改标识：
// 修改描述：
//
// 备注：	
// 				
//-----------------------------------------------------------------------------------------------*/


using HYBY.Task.Service.IService;
using HYBY.Task.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Web.Models;
using HYBY.WebFrameWork.Controllers;
using HYBY.WebFrameWork.Mvc;
using HYBY.Task.DataEntity;

namespace Web.Controllers
{
    public class TBTaskinfoController : BaseController
    {
        private readonly ITBTaskinfoService _service;

        public TBTaskinfoController(ITBTaskinfoService service)
        {
            _service = service;
        }

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 根据查询条件按分页的方式返回任务列表数据
        /// </summary>
        /// <param name="search">查询条件及分页信息</param>
        /// <returns></returns>
        public ActionResult GetTaskinfoList(PageAndSearchInfo search = null)
        {
            var model = new TBTaskinfoListModel();
            model.PageTitle = "首页";
            model.PageSubTitle = "用户管理";
            int RecordCount = 0;
            search.PageSize = 10;
            if (search != null) model.ViewList = _service.GetTBTaskinfos(search.SearchKey, search.PageIndex, 12, out RecordCount);
            ViewBag.RecordCount = RecordCount;
            return PartialView("_TBTaskinfoList", model);
        }
	}
}